import { $http } from '@/utils/httpAxios/index';
import API_INFO from './api-info';
import {CommonRequest} from './interface';


const $axios = (api: any, data: any = {}, options?: any) => {
  console.log(`[发送请求]`, api.url, data);

  return $http(api, data, options)
    .then((res: any) => {
      console.log(`[请求响应]`, api.url, res);
      if (!(res?.code === 110000)) {
      }
      if (!res) {
        console.log(`请求返回数据为空，失败：${JSON.stringify(res)}`);
        return {};
      }
      return res;
    })
    .catch((err: Error) => {
      console.warn(err);
    });
};
export default {
  // 接口声明示例
  getReviewData: (params: any = {}) => {
    return $axios(API_INFO.getData, params);
  },
};
